import request from '@/utils/request'
export default {
    //1 添加课程信息
    addCourseInfo(courseInfo) {
        console.log(courseInfo)
        return request({
            url: '/eduservice/course/addCourseInfo',
            method: 'post',
            data: courseInfo
          })
    },
    //2 查询所有讲师
    getListTeacher() {
        return request({
            url: '/eduservice/teacher/findAll',
            method: 'get'
          })
    },
    //3 根据ID查询课程
    getCourseInfo(id) {
        return request({
            url: '/eduservice/course/getCourseInfo/'+id,
            method: 'get'
          })
    },
    updateCourseInfo(courseInfo){
        return request({
            url: '/eduservice/course/updateCourseInfo',
            method: 'post',
            data: courseInfo
          })
    },
    getPublishCourse(courseId){
        return request({
            url: '/eduservice/course/getPublishCourseInfo/'+courseId,
            method: 'get'
          })
    },
    publishCourse(courseId){
        return request({
            url: '/eduservice/course/publishCourse/'+courseId,
            method: 'post'
          })
    },
    //条件分页查询课程信息
    getPageCourseInfo(current,limit,courseQuery){
        return request({
            url: `/eduservice/course/pageCourseCondition/${current}/${limit}`,
            method: 'post',
            data: courseQuery
          })
    },
    //删除课程信息
    deleteCourse(courseId){
        return request({
            url: `/eduservice/course/deleteCourse/${courseId}`,
            method: 'delete'
          })
    }
}
